package com.qianheng.kit.base.java.statictest;

import java.awt.*;

public class TestStatic {
    public static void main(String[] args) {
        System.out.println(allow(1,"00000"));
        System.out.println(allow(1,null));
        System.out.println(allow(2,"10111"));
        System.out.println(allow(3,"10111"));
    }


    /**
     * 从1开始 默认是允许记录
     */
    public static boolean allow(int index, String strategyStr) {
        if (strategyStr == null) {
            return true;
        }
        if (index > strategyStr.length()) {
            return true;
        }
        return '1' == strategyStr.charAt(index - 1);
    }
}
